# -*- coding: utf-8 -*-

import requests


http_url = 'http://apis.juhe.cn/cook/query'
app_key = '37c90eb0ea9e1551a130092aec19c619'

class Query:


    def get_query(self,  menu,  pn, rn):
        params = {
            'menu':menu,
            'key': app_key,
            'pn':pn,
            'rn':rn
        }
        response = requests.get(url=http_url, params=params)
        if response.status_code == 200:
            print(response.json())
            return response.json()
        else:
            print('接口数据异常')
            return None


if __name__ == '__main__':

    query = Query()
    menu = '西红柿'
    pn = 10
    rn = 3
    query.get_query(menu, pn, rn)



